#include <sys/time.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>


extern void utf8_to_gbk(unsigned char *src, unsigned char *dst);
extern int IsTextUTF8(const char* str);
extern void ucs2_to_gbk(unsigned char *src, unsigned char* dst);

char *src= "00366708003665E5FF0C5C0F7C73603B88C16797658C57285FAE535A5BA35E03FF0C7EA27C73004B003200304E8E8FD165E54E0A53480031003070B999965356FF0C003100390039003951438D77FF0C800C4E148FD867098D6054C1798F522930026797658C8868793AFF1A201C4ECA59294E0A53480031003070B9005200650064006D006900A0004B0032003099965356FF0C9A819F99003700330030590474065668FF0C7D225C3C00340038003000304E078D855E7F89D24E096444FF0C5F3951FA516897625C4F3002003100390039003951438D77FF0C4ECA59294E708FD890010036003951438033673AFF0C66F48D85503CFF0100A0200B200B200B200B201D00366708003665E5FF0C5C0F7C73603B88C16797658C57285FAE535A5BA35E03FF0C7EA27C73004B003200304E8E8FD165E54E0A53480031003070B999965356FF0C003100390039003951438D77FF0C800C4E148FD867098D6054C1798F522930026797658C8868793AFF1A201C4ECA59294E0A53480031003070B9005200650064006D006900A0004B0032003099965356FF0C9A819F99003700330030590474065668003100320033003400350036003700380039";
unsigned char buf[1000];


unsigned char buf2[1000];


//35 D4 C2 31 36 C8 D5 A3 AC C3 C0 D7 DC CD B3 BC B0 D5 FE B8 AE D0 FB B2 BC 
int main()
{
	int len,i;

	printf("src: %s\r\n",src);
	
//	ucs2_to_unicode((unsigned char*)src, (unsigned char*)buf);


//	
//	len= 10;
//	printf("ucs2_to_unicode:\r\n");
//	for(i=0; i<len; i++){
//		printf("%02X ", buf[i]);
//	}
//	printf("\r\n");

	strcpy(buf2, src);
	ucs2_to_gbk((unsigned char*)src, buf2, 0);

	len= strlen((char*)buf2);
	printf("utf8_to_gbk:%s\r\n", buf2);

	
	for(i=0; i<len+10; i++){
		printf("%02X ", buf2[i]);
	}
	printf("\r\n");

	


	
	return 0;
}



